<?php
class ActionUpdateForm extends Zend_Form
{
	public function init()
    {
        $translate =  zend_registry::get('Zend_Translate');        
        $this->setMethod('post');
               
        $this->clearDecorators();
        $this->addElementPrefixPath('Wmp_Validate', 'Wmp/Validate/', 'validate');      
        $this->addElementPrefixPath('Wmp_Filter', 'Wmp/Filter/', 'filter');
        $decorators = array(
            array('ViewHelper'), 
            array('Description'),
            array('Errors'),
            array('Label', array('separator'=>' ', 'requiredSuffix' => ' *', 'class' => 'lefty')),
            array('HtmlTag', array('tag' => 'li')),
        );

        $this->addElement('hidden', 'modname')->modname;
        
        $title = $this->addElement('text', 'title', 
            array('label' => $translate->_('action-tilte'), 'size' => '125'))->title;
            
        $description = $this->addElement('text', 'description', 
            array('label' => $translate->_('action-description'), 'size' => '125'))->description;
         
        $metadescription = $this->addElement('text', 'metadescription', 
            array('label' => $translate->_('action-metadescription'), 'size' => '125'))->metadescription;
        
        $metakeywords = $this->addElement('text', 'metakeywords', 
            array('label' => $translate->_('action-metakeywords'), 'size' => '125'))->metakeywords;
            
        $this->addElement('text', 'layout', 
            array('label' => $translate->_('action-layout'), 'size' => '4'))->layout;
            
        $this->addElement('text', 'menuposition', 
            array('label' => $translate->_('action-menuposition'), 'size' => '4'))->menuposition;
            
        $this->addElement('text', 'menuid', 
            array('label' => $translate->_('action-menuid'), 'size' => '4'))->menuid;        
        
        $title->addFilter('StripSlashes');
        $description->addFilter('StripSlashes');
        $metadescription->addFilter('StripSlashes');
        $metakeywords->addFilter('StripSlashes');
        
        //$email->setDecorators($decorators);
	
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel($translate->_('validate'));
        $submit->clearDecorators();
        $submit->addDecorators(array(
            array('ViewHelper'),    // element's view helper
            array('HtmlTag', array('class' => 'submit')),
        ));
        $this->addElement($submit);

        $this->addDecorator('FormElements')
             ->addPrefixPath('Wmp_Form_Decorator', 'Wmp/Form/Decorator', 'decorator')
             ->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'ul'))
             ->addDecorator('Form');
    }
}